'use strict'

define(['jquery', 'bootstrap','shiftform', 'validate', 'validate.en'], function($) {
  
  return {
        
    init: function() {
    	this.initEdit();
    },
    
    initEdit: function(){
        var that = this;
        
        $(document).on("shown.bs.modal","#code-edit", function(e) {
        	
            var $form = $(e.currentTarget).find("form");
            
            $form.bt_validate();
          
            $form.shiftform({
              beforeSubmit : function(el) {
                $('form').trigger("validate.ajax.submit");
                return $.bt_validate.result[$.bt_validate.form_id]
              }
            });
        })
             
    }
    
   }
})
